a=eval(input())
b=a//1000
c=a//100%10
d=a//10%10
e=a%10
print((e*10+d)==(b*10+c))